import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ost_flutter_module/class/store/order_page/bloc/order_page_bloc.dart';
import 'package:ost_flutter_module/common/adapt.dart';
import 'package:ost_flutter_module/common/color.dart';
import 'package:ost_flutter_module/common/styles.dart';
import 'package:ost_flutter_module/help/ost_route.dart';
import 'package:ost_flutter_module/widget/custom_widget/rounded_button.dart';

class StoreOrderPageBottomNavigationBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocBuilder<OrderPageBloc, OrderPageState>(
        builder: (context, state) {
      return BottomAppBar(
        color: Colors.white,
        child: Padding(
          padding: EdgeInsets.only(
              top: Adapt.px(10), left: Adapt.px(10), right: Adapt.px(10)),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              Expanded(
                child: RichText(
                  text: TextSpan(
                    text: '仍需支付金额：',
                    style: TextStyles.titleStyle,
                    children: [
                      TextSpan(text: '￥1800', style: TextStyles.priceTitleStyle)
                    ],
                  ),
                ),
              ),
              SizedBox(width: Adapt.px(10)),
              RoundedButton(
                  enableColor: colorFACD33,
                  buttonWidth: Adapt.px(120),
                  text: '立即支付',
                  textColor: color42270C,
                  textSize: 16,
                  onTap: () {
                    Navigator.pushNamed(context, GRouter.order_result_page);
                  }),
            ],
          ),
        ),
      );
    });
  }
}
